const proxy = require('http-proxy-middleware');

module.exports = function(app) {
  app.use(proxy('/api',{ 
       target: 'https://music.niubishanshan.top/api/v2/music',
       secure: false,
       changeOrigin: true,
       pathRewrite: {
        "^/api": "/"
       }
    }));
    app.use(proxy('/v',{ 
      target: 'https://c.y.qq.com/base',
      secure: false,
      changeOrigin: true,
      pathRewrite: {
       "^/v": "/"
      }
   }));
   app.use(proxy('/audio',{ 
    target: 'http://dl.stream.qqmusic.qq.com',
    secure: false,
    changeOrigin: true,
    pathRewrite: {
     "^/audio": "/"
    }
 }));
};